package com.deluxelx.soul.inn.common.constant;

import cn.hutool.core.util.StrUtil;
import com.deluxelx.soul.inn.common.param.CollectedParam;

import java.util.HashMap;
import java.util.Map;

import static com.deluxelx.soul.inn.common.constant.UserConstant.USER_CACHE_KEY_PREFIX;

/**
 * 咨询师常数
 *
 * @author: zihao.liao
 * @date: 2024/1/25 17:14
 */
public class CounselorConstant {

    public static final String COUNSELOR_CACHE_KEY_PREFIX = "counselor_";
    // 一周7天
    public static final Integer COUNSELOR_CACHE_EXPIRE_TIME = 60 * 60 * 24 * 7;

    public static final String COUNSELOR_FOLLOW_KEY = "followCounselor";

    public static final String COUNSELOR_CHAT_KEY = "chatCounselor";

    public static final String GRADE_CACHE_KEY = "GradeCache";

    public static final String EXPERT_CACHE_KEY = "ExpertCache";

    public static final String COUNSELOR_CACHE_KEY = "CounselorCache";

    public static final String counselorTaskPattern1 = "user_*:counselor_*";

    public static final String counselorTaskPattern2 = "followCounselor:*";

    public static final Map<Integer, String> GRADE_MAP = new HashMap<Integer, String>(){{
        put(1, "国家特级咨询师");
        put(2, "国家一级咨询师");
        put(3, "国家二级咨询师");
        put(4, "国家三级咨询师");
    }};

    public static final Map<Integer, String> WEEKDAY_MAP = new HashMap<Integer, String>(){{
        put(1, "一");
        put(2, "二");
        put(3, "三");
        put(4, "四");
        put(5, "五");
        put(6, "六");
        put(7, "日");
    }};

    public static final String MORNING = "morning";

    public static final String AFTERNOON = "afternoon";

    public static String buildFollowCounselorKey(CollectedParam param) {
        return USER_CACHE_KEY_PREFIX + param.getUserId() + StrUtil.COLON + COUNSELOR_CACHE_KEY_PREFIX + param.getCounselorId();
    }

    public static String buildFollowCounselorKey(String counselorId) {
        return COUNSELOR_FOLLOW_KEY + StrUtil.COLON + counselorId;
    }

    public static String buildChatCounselorKey(String counselorId) {
        return COUNSELOR_CHAT_KEY + StrUtil.COLON + counselorId;
    }

}
